<?php /*a:2:{s:65:"D:\laragon\www\jiaqueshop\application\manage\view\orders_add.html";i:1585362552;s:59:"D:\laragon\www\jiaqueshop\application\manage\view\base.html";i:1596192950;}*/ ?>
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
	<meta name="renderer" content="webkit">
<title>后台管理系统</title>
<link rel="stylesheet" href="/static/public/awesome/css/font-awesome.min.css" />

<link rel="stylesheet" href="/static/public/layui/css/layui.css" />

<link rel="stylesheet" href="/static/public/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="/static/manage/css/style.css" />

	<link rel="stylesheet" href="/static/public/dist/zoomify.min.css">
	
<script src="/static/public/kindeditor/kindeditor-all.js"></script>
<script src="/static/public/kindeditor/lang/zh_CN.js"></script>
<script src="/static/public/ueditor/ueditor.config.js?t=<?php echo time();?>"></script>
<script src="/static/public/ueditor/ueditor.all.min.js"></script>
<script src="/static/public/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<body>
<?php if($is_auth): ?>

<div class="g-main">
    <div class="m-main-title">
        <div class="m-container-fluid">
            <a href="<?php echo url('index/welcome'); ?>"><i class="icon icon-home"></i>首页</a>
            <span class="icon-angle-right"></span>
            <span>商城</span>
            <span class="icon-angle-right"></span>
            <span>订单管理</span>
            <span class="icon-angle-right"></span>
            <span>订单详情</span>
            <a class="u-flush"><i class="icon-repeat"></i></a>
        </div>
    </div>
    <div class="m-main-content">
        <div class="m-container">
            <div class="m-form">
                <form class="layui-form" id="j_form">
                    <table class="m-table">
                        <thead>
                        <tr>
                            <th colspan="4">查看订单详情</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td width="15%"><label>订单 ID</label></td>
                            <td width="35%"><?php echo htmlentities($info['id']); ?></td>
                            <td width="15%"><label>订单编号</label></td>
                            <td width="35%"><?php echo htmlentities($info['order_no']); ?></td>
                        </tr>
                        <tr>
                            <td width="15%"><label>第三方单号</label></td>
                            <td width="35%"><?php echo htmlentities($info['out_trade_no']); ?></td>
                            <td width="15%"><label>第三方支付单号</label></td>
                            <td width="35%"><?php echo !empty($info['transaction_id']) ? htmlentities($info['transaction_id']) : '-'; ?></td>
                        </tr>
                        <tr>
                            <td width="15%"><label>支付方式</label></td>
                            <td width="35%"><?php echo htmlentities($info['pay_type_name']); ?></td>
                            <td width="15%"><label>下单会员</label></td>
                            <td width="35%"><?php echo htmlentities($info['username']); ?></td>
                        </tr>
                        <tr>
                            <td width="15%"><label>收货人</label></td>
                            <td width="35%"><?php echo htmlentities($info['receiver_name']); ?></td>
                            <td width="15%"><!--<label>会员留言</label>--></td>
                            <td width="35%"></td>
                            <!--<td width="15%"><label>收货人</label></td>-->
                            <!--<td width="35%"><?php echo htmlentities($info['receiver_name']); ?></td>-->
                        </tr>
                        <tr>
                            <td width="15%"><label>收货人联系方式</label></td>
                            <td width="35%"><?php echo htmlentities($info['receiver_mobile']); ?></td>
                            <td width="15%"><label>收货人地址</label></td>
                            <td width="35%"><?php echo htmlentities($info['receiver_province']); ?><?php echo htmlentities($info['receiver_city']); ?><?php echo htmlentities($info['receiver_district']); ?><?php echo htmlentities($info['receiver_address']); ?></td>
                        </tr>
                        <tr>

                            <td width="15%"><label>配送时间</label></td>

                            <td width="35%"><?php echo htmlentities($info['shipping_time']); ?></td>

                            <td width="15%"><label>订单金额</label></td>
                            <td width="35%"><?php echo htmlentities($info['order_amount']); ?></td>
                        </tr>

						<tr>

							<td width="15%"><label>邮费</label></td>

							<td width="35%"><?php echo htmlentities($info['postage_amount']); ?></td>

							<td width="15%"><label>优惠金额</label></td>

							<td width="35%"><?php echo htmlentities($info['coupon_amount']); ?></td>

						</tr>

                        <tr>
                            <td width="15%"><label>实付金额</label></td>
                            <td width="35%"><?php echo htmlentities($info['pay_amount']); ?></td>
                            <td width="15%"><label>积分支付</label></td>
                            <td width="35%"><?php echo htmlentities($info['points']); ?></td>
                        </tr>
                        <tr>
                            <td width="15%"><label>订单状态</label></td>
                            <td width="35%" data-id="<?php echo htmlentities($info['id']); ?>" data-status-id="<?php echo htmlentities($info['order_status_id']); ?>" class="">
                                <?php echo htmlentities($info['order_status_txt']); ?>
                                <!--<?php if($info['order_status_id'] == 0): ?>-->
                                <!--&lt;!&ndash; 待确认 &ndash;&gt;-->
                                <!--<a data-order-status="1">确认订单</a>-->
                                <!--<?php elseif($info['order_status_id'] == 1): ?>-->
                                <!--&lt;!&ndash; 已确认 &ndash;&gt;-->
                                <!--<?php elseif($info['order_status_id'] == 2): ?>-->
                                <!--&lt;!&ndash; 已取消 &ndash;&gt;-->
                                <!--<?php elseif($info['order_status_id'] == 3): ?>-->
                                <!--&lt;!&ndash; 已关闭 &ndash;&gt;-->
                                <!--<?php elseif($info['order_status_id'] == 4): ?>-->
                                <!--&lt;!&ndash; 待付款 &ndash;&gt;-->
                                <!--<a data-pay-status="1">确认收款</a>-->
                                <!--<?php elseif($info['order_status_id'] == 5): ?>-->
                                <!--&lt;!&ndash; 待发货 &ndash;&gt;-->
                                <!--<a data-shipping-status="1">确认发货</a>-->
                                <!--<?php elseif($info['order_status_id'] == 6): ?>-->
                                <!--&lt;!&ndash; 待收货 &ndash;&gt;-->
                                <!--<a data-shipping-status="2">确认收货</a>-->
                                <!--<?php elseif($info['order_status_id'] == 7): ?>-->
                                <!--&lt;!&ndash; 申请退货 &ndash;&gt;-->
                                <!--<a data-shipping-status="3">同意退货</a>-->
                                <!--<?php elseif($info['order_status_id'] == 8): ?>-->
                                <!--&lt;!&ndash; 退货中 &ndash;&gt;-->
                                <!--<a data-shipping-status="4">确认退货</a>-->
                                <!--<?php elseif($info['order_status_id'] == 9): ?>-->
                                <!--&lt;!&ndash; 已退货 &ndash;&gt;-->
                                <!--<?php elseif($info['order_status_id'] == 10): ?>-->
                                <!--&lt;!&ndash; 申请退款 &ndash;&gt;-->
                                <!--<a data-pay-status="2">同意退款</a><a data-pay-status="3">取消退款</a>-->
                                <!--<?php elseif($info['order_status_id'] == 11): ?>-->
                                <!--&lt;!&ndash; 退款中 &ndash;&gt;-->
                                <!--<a data-pay-status="4">确认退款</a>-->
                                <!--<?php elseif($info['order_status_id'] == 12): ?>-->
                                <!--&lt;!&ndash; 拒绝退款 &ndash;&gt;-->
                                <!--<?php elseif($info['order_status_id'] == 13): ?>-->
                                <!--&lt;!&ndash; 已退款 &ndash;&gt;-->
                                <!--<?php elseif($info['order_status_id'] == 14): ?>-->
                                <!--&lt;!&ndash; 已收货 &ndash;&gt;-->
                                <!--<?php elseif($info['order_status_id'] == 15): ?>-->
                                <!--&lt;!&ndash; 已完成 &ndash;&gt;-->
                                <!--<?php endif; ?>-->
                            </td>
                            <td width="15%"><label>支付时间</label></td>
                            <td width="35%"><?php echo htmlentities($info['pay_time_date']); ?></td>
                        </tr>
                        <tr>
                            <td width="15%"><label>发货时间</label></td>
                            <td width="35%"><?php echo htmlentities($info['send_time_date']); ?></td>
                            <td width="15%"><label>签收时间</label></td>
                            <td width="35%"><?php echo htmlentities($info['sign_time_date']); ?></td>
                        </tr>
                        <tr>
                            <td width="15%"><label>订单完成时间</label></td>
                            <td width="35%"><?php echo htmlentities($info['finish_time_date']); ?></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <?php if($info['pay_status']==1): ?>
                        <tr>
                            <td width="15%"><label>物流公司</label></td>
                            <td width="35%"><input style="width: 80%;height: 20px" type="text" name="wl_title" value="<?php echo htmlentities($info['wl_title']); ?>"></td>
                            <td width="15%"><label>物流单号</label></td>
                            <td><input style="width: 80%;height: 20px" type="text" name="wl_number" value="<?php echo htmlentities($info['wl_number']); ?>"></td>
                        </tr>
                        <?php endif; ?>
                        </tbody>
                        <thead>
                        <tr>
                            <th colspan="4">订单商品</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td colspan="4">
                                <table class="m-table m-fields">
                                    <thead>
                                    <tr>
                                        <th width="70%">商品名称</th>

                                        <th width="10%">销售价</th>
                                        <th width="10%">数量</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php if(is_array($info['goods_list']) || $info['goods_list'] instanceof \think\Collection || $info['goods_list'] instanceof \think\Paginator): if( count($info['goods_list'])==0 ) : echo "" ;else: foreach($info['goods_list'] as $key=>$v): ?>
                                    <tr>
                                        <td><?php echo htmlentities($v['goods_name']); ?></td>
                                     
                                        <td><?php echo htmlentities($v['sale_price']); ?></td>
                                        <td><?php echo htmlentities($v['goods_nums']); ?></td>
                                    </tr>
                                    <?php endforeach; endif; else: echo "" ;endif; ?>
                                    </tbody>


                                </table>
                            </td>
                        </tr>
                        </tbody>
                    </table>

                    <div style="width:100%;text-align: center;margin-top: 10px;">
                                <span style="border:0px;background-color:transparent;" data-id="<?php echo htmlentities($info['id']); ?>" data-status-id="<?php echo htmlentities($info['order_status_id']); ?>" class="m-order-action">
                                    <?php if($info['order_status_id'] == 0): ?>
                                    <!-- 待确认 -->
                                    <a data-order-status="1">确认订单</a>
                                    <?php elseif($info['order_status_id'] == 1): ?>
                                    <!-- 已确认 -->
                                    <?php elseif($info['order_status_id'] == 2): ?>
                                    <!-- 已取消 -->
                                    <?php elseif($info['order_status_id'] == 3): ?>
                                    <!-- 已关闭 -->
                                    <?php elseif($info['order_status_id'] == 4): ?>
                                    <!-- 待付款 -->
                                    <a data-pay-status="1">确认收款</a>
                                    <?php elseif($info['order_status_id'] == 5): ?>
                                    <!-- 待发货 -->
                                    <a data-shipping-status="1">确认发货</a>
                                    <?php elseif($info['order_status_id'] == 6): ?>
                                    <!-- 待收货 -->
                                    <a data-shipping-status="2">确认收货</a>
                                    <?php elseif($info['order_status_id'] == 7): ?>
                                    <!-- 申请退货 -->
                                    <a data-shipping-status="3">同意退货</a>
                                    <?php elseif($info['order_status_id'] == 8): ?>
                                    <!-- 退货中 -->
                                    <a data-shipping-status="4">确认退货</a>
                                    <?php elseif($info['order_status_id'] == 9): ?>
                                    <!-- 已退货 -->
                                    <?php elseif($info['order_status_id'] == 10): ?>
                                    <!-- 申请退款 -->
                                    <a data-pay-status="2">同意退款</a><a data-pay-status="3">取消退款</a>
                                    <?php elseif($info['order_status_id'] == 11): ?>
                                    <!-- 退款中 -->
                                    <a data-pay-status="4">确认退款</a>
                                    <?php elseif($info['order_status_id'] == 12): ?>
                                    <!-- 拒绝退款 -->
                                    <?php elseif($info['order_status_id'] == 13): ?>
                                    <!-- 已退款 -->
                                    <?php elseif($info['order_status_id'] == 14): ?>
                                    <!-- 已收货 -->
                                    <?php elseif($info['order_status_id'] == 15): ?>
                                    <!-- 已完成 -->
                                    <?php endif; ?>
                            </span>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<?php endif; ?>
<input type="hidden" name="action_uri" value="<?php echo url('action'); ?>" />

<input type="hidden" name="redirect_uri" value="<?php echo url('index'); ?>" />

<input type="hidden" name="region_uri" value="/manage/regions/regions" />
<script src="/static/public/js/jquery-1.10.2.js"></script>
<script src="/static/public/js/maniac.ui.js"></script>
<script src="/static/public/layui/layui.js" charset="utf-8"></script>
<script src="/static/public/js/aes.js"></script>
<script src="/static/public/js/mode-ecb-min.js"></script>
<script src="/static/public/js/utils.js"></script>
<script src="/static/public/js/dialog.js"></script>
<script src="/static/manage/js/form.js"></script>
<script src="/static/manage/js/js.js"></script>
<script src="/static/public/js/app.js"></script>
<script src="/static/public/js/encrypt.js"></script>
<script src="/static/public/dist/zoomify.min.js"></script>
<script type="text/javascript">
    $('.fdzoom').zoomify();
</script>

<script>
var aesKey = '<?php echo htmlentities($encrypt_key); ?>';
    $(function(){
        layui.use('layer', function(){
            var user_exists = parseInt('<?php echo !empty($user_exists) ? 1  :  0; ?>');
            var user_forbidden = parseInt('<?php echo !empty($user_forbidden) ? 1  :  0; ?>');
            var quit_force = parseInt('<?php echo !empty($quit_force) ? 1  :  0; ?>');
            var is_auth    = parseInt('<?php echo !empty($is_auth) ? 1  :  0; ?>');
            
            if (user_exists) {
                dialog.error('您所登录的用户已被删除', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (user_forbidden) {
                dialog.error('您的账户已被禁用', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }

            if (quit_force) {
                dialog.error('同一账户同一时间只能一人在线', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (!is_auth) {
                dialog.error('您没有权限执行此操作', function(){
                    window.location.href = history.go(-1);
                    return false;
                });
            }
        });
    })
</script>

<script>
    $(function(){
        $('.m-order-action a').on('click', function(){
            var id              = $(this).parent().attr('data-id');
            var order_status    = $(this).attr('data-order-status');
            var pay_status      = $(this).attr('data-pay-status');
            var shipping_status = $(this).attr('data-shipping-status');
            var status = {
                id: id
            };
            if (typeof(order_status) !== "undefined") {
                status.order_status = order_status;
            }
            if (typeof(pay_status) !== "undefined") {
                status.pay_status = pay_status;
            }
            if (typeof(shipping_status) !== "undefined") {
                status.shipping_status = shipping_status;
            }

            //确认收货
            if(shipping_status=='1' || shipping_status==2){
                status.wl_title =  $("input[name='wl_title']").val();
                status.wl_number = $("input[name='wl_number']").val();
            }


            //询问框
            layer.confirm('您确定要执行此操作吗？', {
                btn: ['确定', '取消']
            }, function(){
                $.post('<?php echo url("orderAction"); ?>', status, function(ret){
                    if (ret.status == 0) {
                        dialog.success(ret.message, function(){
                            window.location.reload();
                        });
                    } else {
                        dialog.error(ret.message);
                    }
                }, 'json');
            }, function(){

            });
        });
    })
</script>

</body>
</html>